home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cato / Xm / XmGetSecondaryResourceData.z / XmGetSecondaryResourceData
Encoding:
Text File  |  2002-10-03  |  7.4 KB  |  133 lines

  1.  
  2.  
  3.  
  4.      XXXXmmmmGGGGeeeettttSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa((((UUUU3333NNNNXXXXIIII))))XXXX SSSSyyyysssstttteeeeXXXXmmmmmmmmGGGGVVVVeeeettttSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa((((3333XXXX))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           XXXXmmmmGGGGeeeettttSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa - A function that provides access
  10.           to secondary widget resource data
  11.  
  12.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.           ####iiiinnnncccclllluuuuddddeeee <<<<XXXXmmmm////XXXXmmmm....hhhh>>>>
  14.  
  15.           CCCCaaaarrrrddddiiiinnnnaaaallll XXXXmmmmGGGGeeeettttSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa ((((_w_i_d_g_e_t__c_l_a_s_s, _s_e_c_o_n_d_a_r_y__d_a_t_a__r_e_t_u_r_n))))
  16.                WWWWiiiiddddggggeeeettttCCCCllllaaaassssssss         _w_i_d_g_e_t__c_l_a_s_s;;;;
  17.                XXXXmmmmSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa********_s_e_c_o_n_d_a_r_y__d_a_t_a__r_e_t_u_r_n;;;;
  18.  
  19.  
  20.      VVVVEEEERRRRSSSSIIIIOOOONNNN
  21.           This page documents version 1.2 of the Motif library.
  22.  
  23.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  24.           Some Motif widget classes (such as Gadget, Text, and
  25.           VendorShell) have resources that are not accessible via the
  26.           functions XXXXttttGGGGeeeettttRRRReeeessssoooouuuurrrrcccceeeeLLLLiiiisssstttt and XXXXttttGGGGeeeettttCCCCoooonnnnssssttttrrrraaaaiiiinnnnttttRRRReeeessssoooouuuurrrrcccceeeeLLLLiiiisssstttt.
  27.           In order to retrieve the descriptions of these resources, an
  28.           application must use XXXXmmmmGGGGeeeettttSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa.
  29.  
  30.           When a widget class has such resources, this function
  31.           provides descriptions of the resources in one or more data
  32.           structures.  XXXXmmmmGGGGeeeettttSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa takes a widget class
  33.           argument and returns the number of these data structures
  34.           associated with the widget class.  If the return value is
  35.           greater than 0, the function allocates and fills an array of
  36.           pointers to the corresponding data structures.  It returns
  37.           this array at the address that is the value of the
  38.           _s_e_c_o_n_d_a_r_y__d_a_t_a__r_e_t_u_r_n argument.
  39.  
  40.           The type XXXXmmmmSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa is a pointer to a structure
  41.           with two members that are useful to an application:
  42.           _r_e_s_o_u_r_c_e_s, of type XXXXttttRRRReeeessssoooouuuurrrrcccceeeeLLLLiiiisssstttt, and _n_u_m__r_e_s_o_u_r_c_e_s, of
  43.           type CCCCaaaarrrrddddiiiinnnnaaaallll.  The _r_e_s_o_u_r_c_e_s member is a list of the widget
  44.           resources that are not accessible using Xt functions.  The
  45.           _n_u_m__r_e_s_o_u_r_c_e_s member is the length of the _r_e_s_o_u_r_c_e_s list.
  46.  
  47.           If the return value is greater than 0,
  48.           XXXXmmmmGGGGeeeettttSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa allocates memory that the
  49.           application must free.  Use XXXXttttFFFFrrrreeeeeeee to free the resource list
  50.           in each structure (the value of the _r_e_s_o_u_r_c_e_s member), the
  51.           structures themselves, and the array of pointers to the
  52.           structures (the array whose address is
  53.           _s_e_c_o_n_d_a_r_y__d_a_t_a__r_e_t_u_r_n).
  54.  
  55.  
  56.           _w_i_d_g_e_t__c_l_a_s_s
  57.                  Specifies the widget class for which secondary
  58.                  resource data is to be retrieved.
  59.  
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 4/30/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      XXXXmmmmGGGGeeeettttSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa((((UUUU3333NNNNXXXXIIII))))XXXX SSSSyyyysssstttteeeeXXXXmmmmmmmmGGGGVVVVeeeettttSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa((((3333XXXX))))
  71.  
  72.  
  73.  
  74.           _s_e_c_o_n_d_a_r_y__d_a_t_a__r_e_t_u_r_n
  75.                  Specifies a pointer to an array of
  76.                  XXXXmmmmSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa pointers to be returned by
  77.                  this function.  If the widget class has no secondary
  78.                  resource data (i.e., if the value returned by the
  79.                  function is 0), the function returns no meaningful
  80.                  value for this argument.
  81.  
  82.  
  83.      RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
  84.           Returns the number of secondary resource data structures
  85.           associated with this widget class.
  86.  
  87.      EEEEXXXXAAAAMMMMPPPPLLLLEEEE
  88.           The following example uses XXXXmmmmGGGGeeeettttSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa to
  89.           print the names of the secondary resources of the Motif Text
  90.           widget and then frees the data allocated by the function:
  91.  
  92.           XmSecondaryResourceData * block_array ;
  93.           Cardinal num_blocks, i, j ;
  94.           if (num_blocks = XmGetSecondaryResourceData (xmTextWidgetClass,
  95.                                                        &block_array)) {
  96.             for (i = 0; i < num_blocks; i++) {
  97.               for (j = 0 ; j < block_array[i]->num_resources; j++) {
  98.                 printf("%s\n", block_array[i]->resources[j].resource_name);
  99.               }
  100.               XtFree((char*)block_array[i]->resources);
  101.               XtFree((char*)block_array[i]);
  102.             }
  103.             XtFree((char*)block_array);
  104.           }
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 4/30/98)
  130.  
  131.  
  132.  
  133.